package com.springTest;

import com.config.SpringConfig;
import com.pojo.Master;
import com.service.ResourcesService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //读取配置类
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        ResourcesService resourcesService = ctx.getBean(ResourcesService.class);
        boolean flag = resourcesService.openURL("http://pan.baidu.com/haha", "root ");
        System.out.println(flag);
        //读取配置文件
        ApplicationContext ctx2 = new ClassPathXmlApplicationContext("spring_config.xml");
        Master master = (Master) ctx2.getBean("master");
        master.seyHello();
    }
}
